//
//  MIDIreommCell.m
//  迷笛
//
//  Created by . on 2018/9/15.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIreommCell.h"

@interface MIDIreommCell()

@property (nonatomic, copy) NSDictionary *data;

@end

@implementation MIDIreommCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.headimage];
        [self.headimage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.mas_offset(WidthScale(40));
            make.width.mas_offset(WidthScale(50));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(50):HeightScale(50));
        }];
        [self addSubview:self.recommendName];
        [self.recommendName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.headimage).offset(WidthScale(5));
            make.left.equalTo(self.headimage.mas_right).offset(WidthScale(10));
            [self.recommendName setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.recommendFocus];
        [self.recommendFocus mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.recommendName.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.recommendName);
            [self.recommendFocus setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.recommendTZ];
        [self.recommendTZ mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.recommendFocus);
            make.left.equalTo(self.recommendFocus.mas_right).offset(WidthScale(10));
            [self.recommendTZ setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.recommendFocusBtn];
        [self.recommendFocusBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.mas_offset(WidthScale(-20));
            make.width.mas_offset(WidthScale(50));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeightScale(25):HeightScale(25));
        }];
    }
    return self;
}
-(UIImageView *)headimage
{
    if (!_headimage)
    {
        _headimage =[[UIImageView alloc]init];
        _headimage.layer.masksToBounds = YES;
        [_headimage.layer setCornerRadius:WidthScale(25)]; //设置矩圆角半径
    }
    return _headimage;
}
-(UILabel *)recommendName
{
    if (!_recommendName)
    {
        _recommendName =[[UILabel alloc]init];
        _recommendName.textColor = [UIColor colorWithHexString:@"#FFFEFE"];
        _recommendName.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _recommendName;
}
-(UILabel *)recommendFocus
{
    if (!_recommendFocus)
    {
        _recommendFocus =[[UILabel alloc]init];
        _recommendFocus.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _recommendFocus.font =[UIFont systemFontOfSize:WidthScale(12)];
    }
    return _recommendFocus;
}
-(UILabel *)recommendTZ
{
    if (!_recommendTZ)
    {
        _recommendTZ =[[UILabel alloc]init];
        _recommendTZ.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _recommendTZ.font =[UIFont systemFontOfSize:WidthScale(12)];
    }
    return _recommendTZ;
}
-(UIButton *)recommendFocusBtn
{
    if (!_recommendFocusBtn)
    {
        _recommendFocusBtn =[[UIButton alloc]init];
//        [_recommendFocusBtn setBackgroundColor:[UIColor colorWithHexString:@"#FF005D"]];
//        [_recommendFocusBtn setTitle:@"加入" forState:UIControlStateNormal];
        _recommendFocusBtn.titleLabel.font =[UIFont systemFontOfSize:WidthScale(12)];
        _recommendFocusBtn.layer.masksToBounds = YES;
        [_recommendFocusBtn.layer setCornerRadius:WidthScale(5)];
    }
    return _recommendFocusBtn;
}
@end
